﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SaleOnlineSystem.Controls
{
    public partial class BoxProduct : System.Web.UI.UserControl
    {

        public string NameCategory;
        public string idcat;

        private int idbox = 0;
        public int IdBox
        {
            get { return idbox; }
            set { idbox = value; }

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                rpt_BoxProduct.DataSource = DAL.DCollector.DBCollector.Instance.StoredProcedureSelectBoxTable(
                    "tbl_Product", "tbl_BoxProduct", IdBox, "selectorderbyboxproduct");
                rpt_BoxProduct.DataBind();

                DataTable dt = DAL.DCollector.DBCollector.Instance.StoredProcedureSelectBoxTable("tbl_Category",
                                                                                                 "tbl_BoxProduct", IdBox,
                                                                                                 "selectorderbytitleboxproduct");
                if (dt.Rows.Count > 0)
                {
                    NameCategory = dt.Rows[0]["Category_Name"].ToString();
                    idcat = dt.Rows[0]["Category_ID1"].ToString();
                }
                
            }
        }
    }
}